ProCalc™ Scientific Calculator  
 Copyright © 1994 John Brochu                Version 1.0.0,  May 1994

ProCalc™  is distributed as SHAREWARE. You are allowed to try out the program free for 15 days, after which time a reminder dialog will pop up every 5 days to remind you to register. After the 15 day trial period, if you decide the program is of use to you, you are required to register by filling out the registration form (click Register... in the About dialog), printing it out, and sending it, along with the $20 payment, to the address in the registration dialog. You will receive a registration letter which will contain your unique serial number that will unlock your version of ProCalc, disable the annoying reminder dialog, and enable several new features. You will also receive a disk filled with hundreds of high quality public domain System 7 - format sounds which you can use as system beeps, with programs such as SoundMaster, or just for fun. Also included is the latest version of ProCalc. The disk is provided as a thank you for registering. For organizations with five or more users, site licenses are available at $10 per user.

DISTRIBUTION

ProCalc may not be sold or distributed for profit in any form, either with other products (commercial, shareware, or freeware), or in shareware/freeware collections sold for profit, without the prior written consent of the author. ProCalc may be distributed freely provided it is distributed in a non-profit manner, and is provided in its original unmodified form. However, please notify the author if ProCalc is to be included in non-profit collections on disk, CD ROM, or other media.

DISCLAIMER

The author, John Brochu, makes no warranties regarding this program, its performance, or fitness to any purpose. The author is not responsible for any damage or data loss caused directly or indirectly through the use of this program.

Feature Summary

ProCalc is a full-featured replacement for Apple’s standard Calculator DA. It features a complete set of scientific functions with adjustable display formatting, as well as complete binary math functions with calculations and display in binary, octal, decimal, and hexadecimal. The scientific mode features selectable scientific, engineering, and decimal-only notation, as well as automatic display notation, with floating or adjustable fixed decimal point. The binary math modes feature selectable number sign (signed or unsigned) and size (byte, word, or long), and complete bit wise operators with 680x0 condition code indicators. There is also a 10 number memory with 5 operations, an automatic constant, and up to 50-levels of nested parenthesis.

ProCalc can be configured as a basic 4-function calculator, similar to the Apple Calculator DA. Click the window zoom box at the upper right of the ProCalc window to toggle between basic and full configurations.

ProCalc provides two options for reducing the size of the calculator, so you can tuck it away in the corner of the screen while working in another application. The first, minimize, reduces the calculator to a small display-only window, in which you still have quick access to all of ProCalc’s functions from the keyboard, with full cut & paste support. You can also set ProCalc to display the current time and date while in the background. The second option, iconize, reduces ProCalc to an icon on the desktop. ProCalc can be quickly minimized or iconized by clicking on the iconize button on the calculator.

Balloon Help is available for the calculator buttons, where each button is identified with the full name of the function and its current key assignment, as well as in the Preferences and Key Assignments dialogs.

Keyboard equivalents for all functions are definable, and you can even move the buttons themselves around to suit your own tastes!

A major effort was put into the design, appearance, and operation of ProCalc. Although there are quite a few calculators available for the Mac, ProCalc is one of the easiest and most fun to use. System 7 is fully supported, with Balloon Help and Apple Event support.

System Requirements

ProCalc requires at minimum a Macintosh Plus, and System 6.0.5 or better. MultiFinder is also recommended if you are running System 6, as ProCalc was designed to be run in a multiple-application environment (it does run fine without MultiFinder, though). A color Mac is recommended, but not required. ProCalc will need about 256K of available memory to run.

About ProCalc Help

The help document you are now reading can be printed complete with formatting by choosing the Print... command from the File menu. You should choose Page Setup... first to confirm the printer is set up properly. For best results, turn “Font Substitution” off if your printer has that option.

You can also save this text as a TeachText  document by choosing Save as TeachText... from the File menu. The document is saved complete with a‘styl’  resource, so that it can be read correctly with other style-aware text editors such as Tex-Edit, Joliwrite, and the America Online editor.

ProCalc Help is available both from the Help menu and from the About ProCalc... dialog.

The cursor keys are active on extended keyboards so that you can easily scroll through the help window.

Fonts used in this document are Geneva, Monaco, Times, and Helvetica. (Geneva is replaced with Times when printing.)

Basic Operation

All buttons can be activated with either the mouse or keyboard. The keypad works as expected, with the enter key, as well as the return key, equivalent to the [ = ] button on the calculator. (Note that the enter and return keys are permanently bound to the equals button, and are not reassignable.)

Some of the buttons also have a secondary function that can be activated either by first pressing the [2nd] button or by holding down the control key while pressing the button. Pressing the [2nd] button or control key immediately changes the relevant buttons to indicate their new functions.

Preferences

The Preferences dialog allows you to configure several aspects of ProCalc. Select Preferences... from the File menu to access the dialog. All options are explained below, and are also summarized in Balloon Help.

   Allow drag-clicks - selecting this option allows you to drag the mouse over ProCalc’s buttons, and they will depress and release automatically as you drag from one button to another. If this option is not selected, the buttons will behave like standard Mac buttons.

   Use 3D-style buttons - this option affects how buttons are drawn when they are depressed. Selecting this option will offset them one pixel down and to the right, with appropriate shading, to produce a more enhanced 3D appearance. If this option is left unchecked, the buttons will be not be offset when depressed, only the shading will be changed. This option is not available on non-color monitors.

   Show button text tinge - this option determines whether button labels are drawn with a light-colored tinge or shading one pixel down and to the right. This gives a recessed appearance to the labels, but it slows down redraws slightly. This option is not available on non-color monitors.

   Use small display font - this option determines not only the size of the display font, but also the maximum number of digits that can be displayed in the scientific and basic 4-function modes. See “Numeric Display and Entry” below.

   Show status when minimized - select this option to display the status line in the minimized display window. If this option is not selected, an error condition will be indicated by a dot in the upper right of the display.

   Show clock when in background - this option determines whether the minimized display window will switch to a time and date display when ProCalc is in the background. 

   Show title bar on:
   Minimized window, Iconized window - draw the title bar on the minimized and/or iconized window.

NOTE:  If the title bars are not shown, you can still drag the windows around by dragging the display or the icon itself.

   Switch to previous app on:
   Iconize, Minimize - automatically switch the previous application to the foreground when ProCalc is iconized and/or minimized.

   Iconize button minimizes - this option determines the function of the iconize button. If this option is checked, the button reduces ProCalc to the minimized display window. If unchecked, it iconizes (reduces ProCalc to its iconized state). The alternate function can be performed by pressing the [2nd] button first. This option also determines the function of the following option.

   Iconize (Minimize) on context switch - this option, when enabled, automatically iconizes (minimizes) ProCalc when it is switched to the background, and de-iconizes (maximizes) when switched back to the foreground. The text and function of this button changes depending on the setting of the “Iconize button minimizes” option above.

  Set display background color...  the two buttons relating to this option allow you to change the background color of either the main ProCalc display or the minimized display window. Clicking either button will display the standard Apple Color Picker, from which you can select a new color for the display background. The new background colors are saved with preferences. These options are disabled and unavailable if Color QuickDraw is not detected (on pre-System 7 systems without CQD installed, and on all 68000-based Macs).

   Save with preferences:
   Display register - save the currently displayed value with preferences.
   Memory registers - save all memory contents with preferences.
   Key assignments - save currently defined key assignments with preferences.
   Button arrangement - save current button layout with preferences.

NOTE:  The preceding five options (including saving color preferences) are only available in the registered version of ProCalc.

 The status of all options in this dialog are saved to the ProCalc Preferences file in the System folder when you quit ProCalc. Other options saved are window position and status, calculator display settings, and all calculator mode settings. These settings and options are then restored when ProCalc is next started up. If you wish to bypass these saved settings and restore ProCalc to its default condition, press and hold option as ProCalc starts up.

Iconizing and Minimizing

ProCalc can be quickly reduced to its iconized state by clicking the iconize button on the calculator. The calculator window will be hidden and will be replaced by a small calculator icon on the desktop. Whether or not the icon appears in a window with a drag bar can be set in Preferences. The icon can then be dragged to a convenient location on the desktop, where it will remain until clicked on, or ProCalc is quit. Clicking on the icon restores ProCalc to its previous state.

If the function of the iconize button is set to minimize instead of iconize (see “Preferences” above), then clicking on the iconize button will reduce the calculator to the minimized display window. As with the icon, you can drag the display to any position on the screen, and clicking on the display restores the full calculator. When the minimized display window is active and front-most, all defined keys are available (see “Key Assignments” below), and can be used to perform calculations, as if ProCalc were in its full active state.

The function of the iconize button (minimize or iconize) can be selected in Preferences. The alternate function can be performed by pressing the [2nd] button followed by the iconize button.

ProCalc can be set to automatically switch back to the application that was active before ProCalc when the calculator is iconized or minimized, as well as  automatically iconize or minimize itself when you switch it to and from the background, by selecting these options in Preferences.

The Minimize and Iconize commands are also available from the Options menu, as are their key equivalents.

Numeric Display and Entry

The display in scientific mode has a 12- or 16-digit mantissa with a 2-digit exponent. This is selectable in Preferences. The display in [Hex], [Dec], and [Oct] modes is 16 digits maximum, and in [Bin] mode, 32 digits. In the basic 4-function mode the display is either 8 or 10 digits, with no exponent. This is summarized in the table below.

                        CALCULATOR MODE
   #DIGITS     Basic  Sci  Hex  Dec  Oct  Bin
   Large font    8:0  12:2   16   16   16   32
   Small font   10:0  16:2   16   16   16   32

During number entry, you can delete the last number in the display by pressing the backspace button (or its keyboard equivalent).

The [CE/C] (Clear Entry/Clear) button can be used to clear the current display if numeric entry is in progress, or to clear the calculator if a calculation has just been completed. The [AC] (All Clear) button resets the display and restores the calculator to its default condition.

The Edit menu is accessible at all times so that you can cut and paste numeric text freely to and from ProCalc.

In all modes, there are 50 levels of nested parenthesis available, and the current nesting level is shown in the display.

Automatic Constant

The automatic constant allows you to do repetitive calculations with a common number and operator. The constant is set whenever a two-number operation is completed with the [ = ] button. When a calculation is completed, the operator and the last entered number or result are stored as the automatic constant. You can then enter a new number and press the [ = ] button, and the calculator will automatically complete the operation using the stored operator and constant. You can also repeatedly execute the automatic constant on the current display by simply pressing the [ = ] button. The automatic constant is cleared when the [CE/C] button is pressed, or the calculation mode is changed.

Memory Functions

ProCalc has a total of ten memories, each of which can be used to store a displayed entry or result. One of these memories, the main memory, is accessed directly by pressing one of the five memory function buttons. The nine supplemental memories are accessed by first pressing the [2nd] button, then a memory function button, and finally a numeric button 1 - 9. The five memory functions are as follows...

  [STO], [STOx]  store display contents in memory
  [RCL], [RCLx]  recall memory contents to display
  [EXG], [EXGx]  exchange display contents with memory
  [CLR], [CLRx]  clear (store a 0) in memory
  [SUM], [SUMx]  add display contents to memory

To access the corresponding supplemental memory functions, press the [2nd] button followed by one of the memory function buttons. The memory function button will then lock (stay highlighted), and you may then press a numeric button 1-9 to access memories 1 through 9. The [STOx], [CLRx],  and [SUMx]  functions can also be applied to all nine supplemental memories at once. To do so, instead of pressing a numeric button to access a specific memory, press and hold the control key, and press the desired memory function button again.

NOTE:  Numbers are stored in the memories in a format independent of the current display mode, and always retain their original precision, even when switching between display modes.

There are 10 memory status indicators in the display (M for the main memory, and 1-9 for the nine supplemental memories) that indicate when a memory has non-zero contents.

All memories can be saved along with the current configuration by selecting that option in the Preferences dialog.

NOTE:  The memories cannot be saved if ProCalc is not registered.

Operating Modes

ProCalc can be operated in one of five modes, scientific mode [Sci], and four binary math modes [Hex], [Dec],  [Oct], and [Bin]. As you change modes, the calculator buttons change to indicate the different functions available. The number in the display is retained between modes, so that you can easily do number conversions between bases, as well as mixed calculations. Any numbers stored in the memories are also retained, and will be displayed in the current mode’s format when recalled.

NOTE:  When ProCalc is switched to the basic 4-function mode, the calculator automatically switches to scientific mode with either an 8 or 10 digit display (depending on the display font setting in Preferences), decimal notation (no exponent), and a floating decimal point. The settings in effect when the switch occurred are restored when you switch back out of 4-function mode.

Scientific Mode Functions

Scientific functions are available only when in [Sci] mode, and are as follows...

  [log]  Base 10 log
  [10X]  Inverse base 10 log
  [ln ]  Natural log
  [eX ]  Inverse natural log
  [x2 ]  Square
  [√x ]  Square root
  [x3 ]  Cube
  [3√x]  Cube root
  [yX ]  Universal power
  [x√y]  Universal root
  [1/x]  Inverse
  [ x!]  Factorial
  [ % ]  Percent
  [∆% ]  Delta percent
  [x•y]  Swap x with y
  [P>R]  Polar to rectangular coordinates
  [R>P]  Rectangular to polar coordinates

The percent function works with the [ + ], [ - ], [ x ], and [ ÷ ] keys, or by itself, to perform the following functions...

  X[ + ]Y[ % ][ = ]   Mark-up  ( X plus Y% of X )
  X[ - ]Y[ % ][ = ]   Discount  ( X minus Y% of X )
  X[ x ]Y[ % ][ = ]   Percentage  ( Y% of X )
  X[ ÷ ]Y[ % ][ = ]   Ratio  ( X is what % of Y )
  X[ % ]              Percent to decimal conversion
  X[∆% ]Y[ = ]        Delta percent  ( ( X ÷ Y - 1 ) x 100% )

The delta percent function is activated by pressing the [2nd] button followed by the percent button, and calculates the change in percentage that occurs between two numbers, expressed as a percentage of the second number.

The [x•y] function, in addition to being used in polar to rectangular conversions, can also be used to swap the currently displayed value with the last entered operand. This also effects the automatic constant. 

Polar to rectangular and rectangular to polar calculations are performed by entering the x  or r  value, pressing the [x•y] button to save the x value, entering the y  or Ø  value, then executing the function by pressing the [R>P] or [P>R] button. The resulting r  or x  result is immediately shown in the display. The Ø  or y  part of the result is retrieved by pressing [x•y] to retrieve the y value.

The trigonometric functions are as follows...

  [sin], [cos], [tan]     Standard trig functions
  [asin], [acos], [atan]  Inverse trig functions, press [2nd] button first
  [Hyp]                 Enables hyperbolic equivalents of the above
  [ π ]                 Enter the value of Pi (3.141592653589793...)

The [2nd] and [Hyp] buttons can be used separately or together to invoke the arc (inverse) and hyperbolic trig functions. For instance, if you want the hyperbolic arc sin of a number in the display, depress the [Hyp] and [2nd] buttons before pressing the [sin] button.

You can enter angles in degrees, radians, or grads, depending on the current angle mode as shown in the display. To change the current angle mode, press the [DRG] button. You can convert angles between degrees, radians, and grads by using the [>DRG] button (press the [2nd] button followed by the [DRG] button). All trig calculations, both input and results, use the current angle mode for calculation and display.

Numbers can be entered in scientific notation by entering the mantissa, pressing the [EXP] (Exponent) button, and then entering the exponent (-99...99).

Scientific Mode Display Formatting

ProCalc offers several formatting options for the display in scientific mode. The following  functions effect the display formatting...

  [flo]  Automatic floating point notation - automatically uses either scientific or decimal notation, whichever results in the highest accuracy in the display.
  [sci]  Scientific notation - mantissa with exponent (exponent always displayed).
  [eng]  Engineering notation - same as scientific notation except exponent is always a multiple of three. Useful in dealing with metric measurements where values are commonly powers of three.
  [dec]  Decimal notation - mantissa only, no exponent.

  [fix]  Fix decimal point - press this button followed by a number 0-9 to set the number of decimal places to be shown in the display. To reset the decimal point back to a floating decimal point, press the [fix] button a second time instead of pressing 0-9, ie. press [fix] twice in succession.

NOTE:   if you select the [fix] button with the control key as opposed to pressing the [2nd] button first, you must continue holding the control key while you press the number button. Otherwise, the [2nd] and [fix] buttons will become deselected as soon as you release the control key, and the function will be deactivated.

Binary Math Mode Functions

In any of the binary math modes, the number type (signed or unsigned) can be changed using the [SIGN] button, and the word size (byte - 8 bits, word - 16 bits, or long - 32 bits) can be changed using the [SIZE] button. The size changes from B->W->L as you press the [SIZE] button, or from L->W->B if you press the [SIZE] button while the [2nd] button is depressed. The current sign and word size is shown in the display as ‘SBYTE’, ‘UBYTE’, ‘SWORD’, ‘UWORD’, ‘SLONG’, or ‘ULONG’.

A displayed number may be truncated or sign-extended when switching word sign or size, depending on the size of the number. If it is truncated, an error message will appear in the display, but you can still continue with the calculation if you wish.

Binary math functions are available in [Bin], [Oct], [Dec], and [Hex] modes only and are as follows...

  [AND]  Bit wise AND
  [OR ]  Bit wise OR
  [XOR]  Bit wise exclusive OR
  [MOD]  Modulus (division remainder)
  [NOT]  One’s complement
  [NEG]  Negate (two’s complement)
  [ASL]  Arithmetic shift left
  [ASR]  Arithmetic shift right
  [LSL]  Logical shift left
  [LSR]  Logical shift right
  [ROL]  Rotate left
  [ROR]  Rotate right
  [ASLx] Arithmetic shift left ‘x’ bits
  [ASRx] Arithmetic shift right ‘x’ bits
  [LSLx] Logical shift left ‘x’ bits
  [LSRx] Logical shift right ‘x’ bits
  [ROLx] Rotate left ‘x’ bits
  [RORx] Rotate right ‘x’ bits

The last six operations (shift and rotate ‘x’ operations) use locking buttons, similar to the extended memory functions. Press the button and the button locks, then press a number button 0-9 or A-F, and the operation is completed. Shifts or rotates of 1 to 16 bits are possible with these operations (the 0 button shifts 16 bits at a time).

All operations in this mode (except as noted) execute the corresponding 680x0 instruction directly and then check the CPU condition codes and display the codes in the display. For multiplication, division, and modulus operations, the operation is carried out using floating point arithmetic, then the result is moved into a data register, and the condition codes are checked and displayed. The condition codes displayed are...

    C    Carry
    V    oVerflow (result overflow)
    Z    Zero (result is zero)
    N    Negative (high-order bit is set)

An upper case character indicates the condition is true (bit set), while lower case indicates false (bit cleared). 

Error Messages

There are several possible error conditions that can occur. Following is a list of possible errors and their causes...

  ERROR: DIVIDE BY ZERO         Attempted division by zero
  ERROR: MATH OVERFLOW          Floating point math overflow
  ERROR: MATH UNDERFLOW         Floating point math underflow
  ERROR: DISPLAY OVERFLOW       Result too large to display
  ERROR: DISPLAY UNDERFLOW      Result too small to display
  ERROR: OPERAND OUT OF RANGE   Operand for selected function invalid
  (INTEGER OVERFLOW)            Result too large to fit in current word size

The last error occurs only in the binary math modes, and is a warning only. You can still continue with the calculation, but the result may not be accurate. For all other errors you must press the [CE/C] key to clear the error condition.

Customization

ProCalc can currently be customized in two ways - key assignment, and physical button arrangement. Both options can be exercised whether the program is registered or not. However, these settings are not saved between sessions in the unregistered version, so all changes are lost when you quit ProCalc. You must register to enable saving of custom key assignments and button layout.

Key Assignments

The Key Assignments dialog is accessed from the Edit menu, or by holding the command key while clicking one of the calculator buttons. The calculator must be in its full or 4-function state (buttons visible) to access the dialog. The dialog is a movable-modal dialog, which means it can be moved around freely using the drag bar, but must be dismissed before using any other function of ProCalc.

Key Assignments allows you to assign any key combination to any button on the calculator. A key combination can be any combination of the shift, option and command keys (the control key is reserved by ProCalc), along with one other key.

NOTE:  The numeric and arithmetic function buttons are permanently bound to their respective keys, and cannot be changed. Also, the enter and return keys are bound to the [ = ] function, and cannot be assigned to any other function.

To select a button to assign a key to, simply bring up the Key Assignments dialog, and click any button on the face of the calculator. The Function and Key assignment fields are updated to reflect the button’s function and current key assignment. To change the key assigned to the button, simply press the desired key combination. Click Revert to disregard changes made to the assignment since the function was selected, click Unassign to erase the key assignment and make it undefined, and click Done to accept the current assignment and dismiss the dialog.

NOTE:  You can move the calculator window from under the Key Assignments dialog by command-dragging the title bar.

Button Layout

All buttons on the main calculator and on the 4-function calculator can be rearranged. To do so, press and hold the option key while clicking the button you wish to move. Now drag to the new location. The button you dragged to will swap positions with the button initially selected. If you change your mind before releasing the button, just drag the button to the face of the calculator so that no buttons are selected, and release the button. No changes will be made to the button positions.

About the Menus

Apple Menu

About ProCalc™...
Brings up the About dialog which displays copyright and registration information, along with the Register... and Help... buttons, which allow you to fill out and print your registration form, and bring up the ProCalc Help window, respectively.

File Menu

Close
Closes the currently active window. If the main calculator or minimized display window is front-most, ProCalc will also be quit. This performs the same function as the close box in the window’s title bar.

Save
Disabled except when the ProCalc Help window is front-most, in which case this command changes to Save as TeachText..., which allows you to save the help text as a TeachText document, complete with‘styl’  information. See “About Help” above.

Preferences...
Brings up the Preferences dialog, which allows you to change several characteristics of ProCalc. See “Preferences” above.

Page Setup...
Displays the current printer’s Page Setup dialog. Disabled except when the ProCalc Help window is active. See “About Help” above.

Print...
Displays the current printer’s Print dialog. Disabled except when the ProCalc Help window is active, in which case it allows you to print out a formatted copy of the help text. See “About Help” above.

Quit
Quits ProCalc.

Edit Menu

Undo
Not available in this version of ProCalc.

Cut
Copies the currently displayed value to the clipboard as text, and clears the calculator.

Copy
Copies the currently displayed value to the clipboard as text. Does not effect the display.

Paste
Replaces the currently displayed value with ProCalc’s numeric interpretation of the text currently in the clipboard. If the text cannot be interpreted as a number, ProCalc assumes a zero value.

Clear
Clears the calculator (same function as the [CE/C] button).

Key Assignments...
Displays the Key Assignments dialog, allowing you to assign keys to calculator functions. See “Key Assignments” above.

Options Menu

Minimize
Reduces the full or 4-function calculator windows to a display-only window. See “Iconizing and Minimizing” above.

Iconize
Reduces the full or 4-function calculator windows, or the minimized display window, to an icon on the desktop. See “Iconizing and Minimizing” above.

Contacting the Author

I hope you enjoy using ProCalc. If you have any suggestions for improvement, new features, or most of all, bug reports, please contact me at one of the addresses below. I have done my best to make ProCalc the best calculator available for the Mac, and will continue to improve it, based on YOUR input. If you have any ideas, please write!

America OnLine:  JohnBrochu
Compuserve:      70376,1235
GEnie:           JAKOB

US Mail:         John Brochu
                 PO Box 645
                 Beverly, MA  01915